public class Demo1 {
    public static void main(String[] args) {
        new Thread(null, () -> {
            while (true){

            }
        }, "thread1").start();

        new Thread(null, () -> {
            try {
                Thread.sleep(1000000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }, "thread2").start();


        new Thread(null, () -> {
            try {
                Thread.sleep(1000000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }, "thread3").start();
    }
}
